package mts.messages;

import mts.constants.MessageType;

public class ElevatorControllerInitMessage extends Message {

	private static int INDEX_CAR = Message.INDEX_MESSAGE_TYPE + 1;
	private byte car;
	
	public byte getCar() {
		return car;
	}
	
	private ElevatorControllerInitMessage() {
		super(MessageType.EC_INIT_MSG);
	}
	@Override
	public byte[] serialize() {
		byte data[] = new byte[2];
		data[Message.INDEX_MESSAGE_TYPE] = getMessageType().getByteValue();
		data[INDEX_CAR] = car;
		
		return data;
	}
	
	public static ElevatorControllerInitMessage deserialize(byte[] data) {
		ElevatorControllerInitMessage message = new ElevatorControllerInitMessage();
		message.car = data[1];
		
		return message;
		
	}

}
